<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        Object.prototype.mobileClick = function (callback = function (e) { }) {
            this.startX = null;
            this.startY = null;
            this.endX = null;
            this.endY = null;
            this.addEventListener('touchstart', function (e) {
                this.startX = e.changedTouches[0].clientX;
                this.startY = e.changedTouches[0].clientY;
            })
            this.addEventListener('touchend', function (e) {
                this.endX = e.changedTouches[0].clientY;
                this.endY = e.changedTouches[0].clientY;
                if (Math.abs(this.endX - this.startX) < 60 || Math.abs(this.endY - this.startY) < 60) {
                    callback(e);
                }
            })
            return this;
        }
        document.mobileClick(function(e){
            console.log(1);
            console.log(e);
        })
    </script>
</body>

</html>